<template>
  <div class="sortBtn">
    <div class="leftContainer">
      <div class="icon"><img :src="apply.icon" class="iconfont" /></div>
      <div class="title">{{ apply.name }}</div>
    </div>
    <div class="rightIcon">
      <a-icon
        type="minus-circle"
        v-if="apply.show"
        @click="deleteApply(apply)"
      />
      <a-icon type="plus-circle" v-else @click="addApply(apply)" />
    </div>
  </div>
</template>
<script>
export default {
  name: "sortBtn",
  props: {
    apply: {
      type: Object,
      default: () => {}
    }
  },
  methods: {
    deleteApply(item) {
      this.$emit("deleteApply", item);
    },
    addApply(item) {
      this.$emit("addApply", item);
    }
  }
};
</script>
<style lang="less" scoped>
.sortBtn {
  width: 260px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  margin: 10px 10px 10px 0;
  cursor: pointer;
  .leftContainer {
    display: flex;
    justify-content: flex-start;
    .icon {
      background: #f6f9fe;
      border-radius: 4px;
      padding: 5px 10px;
      .iconfont {
        width: 20px;
        height: 20px;
        color: #386bd7;
      }
    }
    .title {
      padding-left: 10px;
      font-size: 14px;
      color: #333;
      line-height: 30px;
    }
  }
  .rightIcon {
    color: #999;
    font-size: 14px;
    line-height: 30px;
    cursor: pointer;
  }
}
</style>